#include <iostream>
using namespace std;

#define INT_MAX 32768
const int floor = 300;
const int egg = 3;
int twoegg(int n);

int main(int argc, char *argv[])
{

#if 1
    int temp;
    int re;
    int a[floor+1][egg+1];
    for (int i = 1; i <= floor; i++) {
        a[i][1] = i;
        a[i][0] = 0;
    }
    for (int i = 0; i <= egg; i++) 
        a[0][i] = 0;
    
    for (int i = 2; i <= floor; i++) {
        for (int j = 2; j <= egg; j++) {
            re = INT_MAX;
            for (int k = 1; k <= i; k++) {
                temp = max(a[i-k][j], a[k-1][j-1]) + 1;
                if (temp < re)
                    re = temp;
            }
            a[i][j] = re;
        }
    }
    cout << a[floor][egg] << endl;
#endif
    //cout << twoegg(100) << endl;
    return 0;
}

int twoegg(int n)
{
    int f[floor];
    f[0] = 0;
    f[1] = 1;
    int re;
    int temp;
    
    for (int i = 2; i <= n; i++) {
        re = INT_MAX;
        for (int j = 1; j <= i; j++) {
            temp = 1+max(j-1, f[i-j]);
            if (temp < re) 
                re = temp;
        }
        f[i] = re;
    }
    
    return f[n];
}
